<?php
$album_setting = array(
    'table_name' => 'albums',
    'key_field' => 'id',
    'value_field' => 'title'
    
);
?>

    <div id ="content">
    <?php if ($this->session->flashdata('error')): ?>
        <div class="affiche_erreur">
        <?php echo $this->session->flashdata('error'); ?>
    </div>
    <?php endif; ?>
    <?php echo form_open_multipart('admin_media/add_images'); ?>
        <div id="title_content">Upload ảnh</div>
        <table class="form_content" width="100%">
        
            <td>Image</td>
            <td>
                <?php if (isset($error))
                    echo $error; ?>
                <input type="file" name="userfile[]" size="20" class="multi" />
            </td>
        </tr>
        <tr>
            <td>Album</td>
            <td>
            <?php if (form_error('album_id')!=""){?> <div class="form_error"><?php echo generate_pure_text(form_error('album_id'), '<p>', '</p>'); ?></div> <?php } ?>
<?php echo form_dropdown('album_id', dropdown_data($album_setting)); ?>
            </td>
        </tr>
        <tr>
            <td colspan="2"><?php echo form_submit('submit', 'Upload', 'class="form_submit"') ?></td>
        </tr>
    </table>
<?php echo form_close(); ?>
            </div>
